#include "trap.h" 
    .org 0x0
    .text
    .global _start
_start:
    lu12i.w     $a0,-0x7fc00      # a0 = 0x80400000
    pcaddu12i   $a1, 0x11111      # a1 = 0x11111000+0x80000004 = 0x91111004
    addi.w      $a3, $a3, 0x1aa   # a3 = 0x1aa
    pcaddu12i   $a4, 0x11111      # a4 = 0x11111000 + 0x8000000c = 0x9111100c
    addi.w      $a5, $a5, 0x1bb   # a5 = 0x1bb
    addi.w      $a6, $a6, 0x100   # a6 = 0x100
    andi        $a2, $a1, 0xfcc   # a2 = 0x91111fd0
    andi        $s0, $a1, 0xfcc   # s0 = 0x00000004
    sltu        $t1, $a1, $a0     # t1 = 0x1
    xor         $s1, $a5, $a3     # s1 = 0x00000066
    addi.w      $s2, $a3, 0x1cc   # s2 = 0x00000376
    st.w        $a0, $s4, 0x7ff   # 0x7ff = a0 = 0x80400000
    st.b        $a1, $s4, 0x001   # 0x001 = a1 = 0x91111004
    ld.w        $s5, $s4, 0x7ff   # s5 = 0x80400000
    ld.b        $s6, $s4, 0x001   # s6 = 0x91111004
    lu12i.w     $t0, 0x22222      # t0 = 0x22222000
    or          $t2, $a6, $a3     # t2 = 0x000001aa
    sltu        $t5, $s2, $s1     # t5 = 0x1
    lu12i.w     $a0, 0x22fcc      # a0 = 0x22fcc000
    ori         $a1, $a2, 0xbbb   # a1 = 0x91112b8b
    sltu        $t3, $s6, $s5     # t3 = 0x0
    addi.w      $a3, $a5, 0x4aa   # a3 = 0x00000665
    xor         $t2, $s5, $s6     # t2 = 0x11511004
    st.w        $a0, $s4, 0x711   # 0x711 = a0 = 0x22fcc000
    st.b        $a1, $s4, 0x111   # 0x111 = a1 = 0x80400bff
    ld.w        $s1, $s4, 0x7ff   # s1 = 0x22fcc000
    ld.b        $s2, $s4, 0x001   # s2 = 0x80400bff
    sltu        $s3, $t3, $t1     # s3 = 0x1
    sra.w       $t4, $a0, $a1     # t4 = 0x45f9
    HIT_GOOD_TRAP
    
